//
//  UITextField+PlaceHolder.m
//  DailyRecord
//
//  Created by Gin on 2022/3/28.
//

#import "UITextField+PlaceHolder.h"

@implementation UITextField (PlaceHolder)

- (void)setPlaceholderFont:(UIFont *)font{
    if (@available(iOS 13.0, *)) {
        NSMutableAttributedString *placeholderString = [[NSMutableAttributedString alloc] initWithString:self.placeholder attributes:@{NSFontAttributeName : font}];
        self.attributedPlaceholder = placeholderString;
    }else{
        [self setValue:font forKeyPath:@"_placeholderLabel.font"];
    }
}

@end
